<template>
  <view class="padding-10">
    <block v-for="(item,index) in merchantList" :key="index">
      <view class="mainColor colorB border-10" style="border: 1px solid #fff;margin-bottom: 20rpx;">
        <navigator class="padding-10 color0" :url="'/carrierDetail/detail/detail?id='+ item.id">
          运营商名称：{{item.merchantName}}
        </navigator>
        <!-- <view class="padding-10">地址：{{item.address}}</view> -->
        <view class="padding-10">状态：{{item.status}}</view>
        <view class="padding-10">组织机构代码：{{item.organizationCode}}</view>
        <view class="padding-10">负责人姓名：{{item.managerName}}</view>
        <view class="padding-10">负责人电话号码：{{item.managerPhone}}</view>
        <view class="padding-10">客服电话号码：{{item.servicePhone}}</view>
        <view class="padding-10">公司logo：
          <image :src="item.logoUrl" mode="widthFix" style="width: 200rpx;" />
        </view>
      </view>
    </block>
    <pagination :queryParams="queryParams" :total="total" @changeNum="changeNum" @changeAdd="changeAdd" @reset="reset">
    </pagination>
  </view>
</template>

<script>
  import {
    listMerchant,
  } from "@/api/pile/merchant";
  export default {
    data() {
      return {
        total: 0,
        merchantList: [],
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          merchantName: null,
          address: null,
          status: null,
          organizationCode: null,
          managerName: null,
          managerPhone: null,
          servicePhone: null,
          logoUrl: null,
        },
      };
    },
    methods: {
      getList() {
        listMerchant(this.queryParams).then((response) => {
          this.merchantList = response.rows;
          // console.log(this.merchantList, '运营商详情');
          this.total = response.total;
        });
      },
      // 组件传递的事件 0
      changeNum(e) {
        this.queryParams.pageNum = e
        this.getList()
      },
      changeAdd() {
        this.merchantList = []
        this.queryParams.pageSize += 10
        this.getList()
      },
      reset() {
        this.merchantList = []
        this.queryParams.pageSize = 10
        this.queryParams.pageNum = 1
        this.getList();
      },
    },
    onLoad() {
      this.getList()
    }
  }
</script>

<style lang="scss" scoped>

</style>